import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
import Service from '../../request'

export function login(user: UserInfo) {
  return Service.post<
    UserInfo,
    AxiosResponse<Response<{ access_token: string }>>
  >('auth/login', user)
}

export function register(user: UserInfo) {
  return Service.post<UserInfo, AxiosResponse<Response<{ message: string }>>>(
    '/user',
    user,
  )
}
